package app.cn.com.school.api;

import app.cn.com.school.api.bean.BaseRequest;
import app.cn.com.school.api.bean.response.IndexResponse;
import app.cn.com.school.api.bean.response.LoginResponse;
import app.cn.com.school.api.bean.response.TestResponse;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import rx.Observable;

/**
 * Created by Administrator on 2017/10/18 0018.
 */

public interface Api {
    @POST("/index/")
    Observable<TestResponse> test(@Body BaseRequest request);

    /**
     * 获取验证码
     */
    @FormUrlEncoded
    @POST("mobile/index.php?act=login&op=sendCode")
    Observable<TestResponse> sendCode(@Field("phone") String phone, @Field("type") String type);

    /**
     * 注册
     */
    @FormUrlEncoded
    @POST("mobile/index.php?act=login&op=sms_register")
    Observable<TestResponse> register(@Field("phone") String phone, @Field("code") String code, @Field("password") String password);

    /**
     * 登录
     */
    @FormUrlEncoded
    @POST("mobile/index.php?act=login&op=index")
    Observable<LoginResponse> login(@Field("username") String username, @Field("password") String password);

    /**
     * 忘记密码--修改支付密码
     * */
    @FormUrlEncoded
    @POST("mobile/index.php?act=login&op=forgotPassword")
    Observable<TestResponse> pwd(@Field("code") String code,@Field("username") String username,@Field("password") String password,@Field("type") String type);

    /**
     * 首页
     * */
    @POST("mobile/index.php?act=index&op=index")
    Observable<IndexResponse> index();

    /**
     * 第三方注册-----
     */
    @FormUrlEncoded
    @POST("mobile/index.php?act=login&op=thirdRegister")
    Observable<TestResponse> thirdRegister(@Field("username") String username, @Field("password") String password, @Field("code") String code, @Field("nick") String nick, @Field("avatar") String avatar, @Field("openid") String openid, @Field("type") String type, @Field("client") String client);

    /**
     * 第三方登录-----
     */
    @FormUrlEncoded
    @POST("mobile/index.php?act=login&op=thirdLogin")
    Observable<TestResponse> thirdLogin(@Field("openid") String openid, @Field("type") String type, @Field("client") String client);

    /**
     * 等级----
     */
    @FormUrlEncoded
    @POST("mobile/index.php?act=member_vr_buy&op=vip")
    Observable<TestResponse> vip(@Field("key") String key);

    /**
     * 积分商品---
     */
    @FormUrlEncoded
    @POST("mobile/index.php?act=goods&op=vip_goods")
    Observable<TestResponse> vipGoods(@Field("key") String key);

    /**
     * 一般商品---
     */
    @FormUrlEncoded
    @POST("mobile/index.php?act=goods&op=goods")
    Observable<TestResponse> goods(@Field("key") String key);


}
